# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=gtkhtml
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}3"
pkgver=4.8.5
pkgrel=1
pkgdesc="Library for embedding a lightweight web browser in GTK programs (mingw-w64)"
arch=('any')
url="https://www.gnome.org"
license=("LGPL")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"
             "${MINGW_PACKAGE_PREFIX}-gettext"
             "${MINGW_PACKAGE_PREFIX}-pkg-config"
             "${MINGW_PACKAGE_PREFIX}-gsettings-desktop-schemas"
             "${MINGW_PACKAGE_PREFIX}-iso-codes"
             "intltool")
depends=("${MINGW_PACKAGE_PREFIX}-enchant"
         "${MINGW_PACKAGE_PREFIX}-gtk3"
         "${MINGW_PACKAGE_PREFIX}-libsoup"
         "${MINGW_PACKAGE_PREFIX}-libsystre")
options=(!libtool strip staticlibs)
source=("https://download.gnome.org/sources/${_realname}/${pkgver%.*}/${_realname}-${pkgver}.tar.xz")
sha256sums=('2ff5bbec4d8e7eca66a36f7e3863a104e098ce9b58e6d0374de7cb80c3d93e8d')

prepare() {
  cd ${_realname}-$pkgver
}

build() {
  mkdir -p "${srcdir}/build-${MINGW_CHOST}"
  cd "${srcdir}/build-${MINGW_CHOST}"

  ../${_realname}-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --enable-shared \
    --disable-static

  LC_ALL=C make
}

package() {
  cd "${srcdir}/build-${MINGW_CHOST}"
  make DESTDIR="$pkgdir" install
}
